package com.dongjiantong.common.exceptions;

/**
 * Created by cao on 2017/10/27.
 */
public abstract class OPException extends RuntimeException {
    private static final long serialVersionUID = -3244090102284160027L;
    protected int code = 500;
    protected String reason = "Bad Request";
    protected Object[] args;

    public OPException(int code, String reason) {
        super(reason);
        this.code = code;
        this.reason = reason;
    }

    public OPException(int code, String reason, Object... args) {
        super(reason);
        this.code = code;
        this.reason = reason;
        this.args = args;
    }

    public int getCode() {
        return this.code;
    }

    public Object[] getArgs() {
        return this.args;
    }

    public String getReason() {
        return this.reason;
    }
}
